const GeminiConfig = require('./GeminiConfig.json');
const Gemini = require('./gemini');

Gemini.createInstance(GeminiConfig).then(async gemini => {
    const stamp = await gemini.getReplyStream("123123", "你好！");
    const cb = (res) => {
        console.log(res);
        if(res.piece === "finish") gemini.removeListener(stamp, cb);
    }
    gemini.on(stamp, cb);
})

Gemini.createInstance(GeminiConfig).then( gemini => {
    gemini.getReply("123123", "你好！")
        .then(r => console.log(r))
        .catch(err => console.log(err));
})